package map
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	
	import instance.GameObjectManager;
	
	import view.*;
	
	public class ScrollMapLayer extends Sprite
	{
		public var type:String;
		public var layerWidth:Number;
		public var layerHeight:Number;
		
		public var gameObjManager:GameObjectManager;

		public function ScrollMapLayer(t:String,width:Number,height:Number)
		{
			super();
			this.type = t;
			this.layerWidth = width;
			this.layerHeight = height;
			gameObjManager = new GameObjectManager(width,height);
		}
		
		public function enterFrame():void {
			gameObjManager.enterFrame();
			
			this.graphics.clear();
			this.graphics.beginBitmapFill(gameObjManager.backBuffer, null, false, false);
			this.graphics.drawRect(0, 0, this.layerWidth, this.layerHeight);
			this.graphics.endFill();
		}
		
		/*override public function set width(value:Number):void
		{
			this.graphics.beginFill(0,0);
			this.graphics.drawRect(0,0,value,height);
			this.graphics.endFill();
		}
		
		override public function set height(value:Number):void
		{
			this.graphics.beginFill(0,0);
			this.graphics.drawRect(0,0,width,value);
			this.graphics.endFill();
		}*/
	}
}